define(function(require, exports, module) {

  var Backbone = require('backbone');
  var $ = require('jquery');
  var _ = require('underscore');
  var jsonview = require('jsonview');

  // var echarts = require('js/echarts');
  var echarts = require('/npm/show-react16-r15.20-uyuncomponents/node_modules/echarts/dist/echarts.min')
  
  var env = window.env;

  var bar = require('v/graph/option/bar')

  function main() {
    var $app = $('<div id="app">').width(env.w).height(env.h);
    $('#main').html($app);

    var chart = echarts.init($app[0]);

    chart.setOption(bar, true)

    chart.on('click', function (params) {
      console.log(params)
    });
  }

  function dataProcess(arr) {
    return arr.map(function(item) {
      item += 0.01;
      return item;
    })
  }

  function step(chart) {

    var draw = function() {
      requestAnimationFrame(draw);

      var data = bar.series[0].data;
      bar.series[0].data = dataProcess(data);

      chart.setOption(bar, true)
    }

    draw();
    
  }

  return main;
})
